from cashflow.models import *
from django.contrib import admin

class AccountAdmin(admin.ModelAdmin):
    pass
    
class CategoryAdmin(admin.ModelAdmin):   
    fieldsets = (
        (None, {
            'fields': ('user', 'name'),
        }),
    )
    list_display = ('user', 'name','type','tax','description')
    search_fields = ('user',)    
    
class TransactionAdmin(admin.ModelAdmin):
    list_display = ('date','user', 'account','name','category','amount','description')
    list_filter = ['date','user']
    search_fields = ['user']
    date_hierarchy = 'date'
    fieldsets = (
        (None, {
            'fields': ('user', 'account','name','category','amount', 'date'),
        }),
    )    
    
class BillAdmin(admin.ModelAdmin):
    pass
    
class RuleAdmin(admin.ModelAdmin):
    pass    
    
class BudgetAdmin(admin.ModelAdmin):
    pass       
    
admin.site.register(Account,AccountAdmin)
admin.site.register(Category,CategoryAdmin)
admin.site.register(Transaction,TransactionAdmin)
admin.site.register(Bill,BillAdmin)
admin.site.register(Rule,RuleAdmin)
admin.site.register(Budget,BudgetAdmin)